package influx;


import org.influxdb.InfluxDB;
import org.influxdb.InfluxDBFactory;

/**
 * @author carlin
 */
public class InfluxDBUtils {

    private static InfluxDB influxDB;


    public static InfluxDB getSingleton(String userName, String password, String url) {
        if (influxDB == null) {
            synchronized (InfluxDBUtils.class) {
                if (influxDB == null) {
                    influxDB = InfluxDBFactory.connect(url, userName, password);
                }
            }
        }
        return influxDB;
    }

}

